package com.leviassaf.androidbasics;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.speech.SpeechRecognizer;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

import java.util.ArrayList;

public class Voice extends Activity implements View.OnClickListener {
	static final int intCheck = 11111;
	ListView lstvwVoiceReturn;
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if ((requestCode == intCheck) && (resultCode == -1)) {
			ArrayList localArrayList = data.getStringArrayListExtra("android.speech.extra.RESULTS");
			ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, localArrayList);
			this.lstvwVoiceReturn.setAdapter(arrayAdapter);
		}
	}

	public void onClick(View paramView) {
		Intent localIntent = new Intent("android.speech.action.RECOGNIZE_SPEECH");
		localIntent.putExtra("android.speech.extra.LANGUAGE_MODEL", "free_form");
		localIntent.putExtra("android.speech.extra.PROMPT", "Speak up son!!!");
		startActivityForResult(localIntent, intCheck);
	}

	protected void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		setContentView(R.layout.voice);
		this.lstvwVoiceReturn = ((ListView) findViewById(R.id.lstvwVoiceReturn));
		((Button) findViewById(R.id.btnVoice)).setOnClickListener(this);
	}
}

/*
 * Location: D:\temp\recover_android\classes_dex2jar.jar Qualified Name:
 * com.leviassaf.androidbasics.Voice JD-Core Version: 0.6.2
 */